Property ID 1

Property ID 1 is reserved as an indicator of which code page (Windows) or Script (Macintosh) to use when interpreting the strings in the property set. All string values in the property set must be stored with the same code page. The originating operating system value in the property set header (PROPERTYSETHEADER::dwOSVer) determines whether the code page indicator corresponds to a Windows code page or Macintosh script.

When an application that is not the author of a property set changes a property of type string in the set, it should examine the code page indicator and take one of the following actions:

    Write the string in the format specified by the code page indicator.

    Replace and rewrite to change the code page.

 

If an application cannot understand this indicator, it should not modify the property. All creators of property sets must write a code page indicator; however, if the code page indicator is not present, the prevailing code page on the reader s machine must be assumed.

 

Note  If the IPropertySetStorage interface is used to create a property set, the code page indicator is automatically written.

 

Possible values for the code page are given in the Win32 API (see the GetACP function) and Inside Macintosh Volume VI,  14-111. For example, the code page US ANSI is represented by 0x04E4 (1252 in decimal) while the code page for Unicode is 0x04B0 (1200 in decimal).

It is recommended that the Unicode code page be used whenever possible, and use VT_LPWSTR instead of VT_LPSTR to avoid multibyte <-> Unicode conversions during storage and retrieval. Using the same code page for all property sets is the only way to achieve interoperable property sets on a worldwide basis. In either the Unicode or non-Unicode code page, note that the count at the start of a VT_LPSTR or VT_BSTR is a byte count and not a character count. This byte count includes the one or two zero bytes at the end of the string (the string s NULL terminator).

Property ID 1 is a VT_12 type and thus starts with a DWORD containing the value VT_12 followed by a USHORT indicating the code page.